﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>


<!DOCTYPE html>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="apple-itunes-app" content="app-id=591578609">
<meta name="viewport" content="width=device-width"/>
<meta name="description" content="德瑞姆网校" />
<meta name="keywords" content="德瑞姆网校、心理学、考试"/>
<link href="${imgpath}/images/favicon.ico" type="image/x-icon" rel="shortcut icon" />
<link rel="stylesheet" type="text/css" href="${csspath}/style/style.css">
<link rel="stylesheet" type="text/css" href="${csspath}/style/index.css">
<link rel="stylesheet" type="text/css" href="${csspath}/style/h_index.css">
<link rel="stylesheet" type="text/css" href="${csspath}/style/shop.css">
<!--[if IE 7]>
<link rel="stylesheet" href="/css/font-awesome/css/font-awesome-ie7.min.css">
<![endif]-->

<script type="text/javascript"src="${jspath}js/jquery-1.7.1.min.js"></script>

<script type="text/javascript" >
	// var promotions = ${promotion};	
	$(document).ready(function(){
		$('#allcheck').change(function(){
			$('.shop_shopbody01 input').attr('checked', $(this).is(':checked'));
			calculateAmount();
		});
	});

	function nextPay(){
		var datas = {
			orderId : $("#orderId").val(),
			// orderToken : $("#orderToken").val(),
			// orderPrice : $("#orderPrice").val(),
			// payCorn : $("#payCorn").val(),
			payTp : $("#payTp").val()
		};

		// 调用支付完成弹出层
		// dailog.show()?

		$.ajax({
		    type: "get",
		    async: false,
		    url: "/shop/gopay",
		    dataType:"json",
	 	    /* headers: {
	 	          "Accept" : "text/plain; charset=utf-8",
	 	          "Content-Type": "application/json; charset=utf-8"
	 	      },
	 	    contentType: "application/json;charset=UTF-8", */
	 	    /*  data:JSON.stringify(datas) ,  for post */
			data: datas,
			success: function(data) {
				// alert(data.code);
				if(data.code == 1) {
					window.open(data.payUrl);
				} else {
					alert("创建支付失败");
				}
	 		}
		});

	}
 
	// 支付完成调用函数，跳转到支付完成页面
	function paySuccess() {
		location.href = '/shop/shopsucces?orderId=${order.orderId}';
	}
</script> 
<title>德瑞姆教育</title>
</head>
<body align="center" style="padding:0;margin:0 auto;clear:both; align:center;">

<!--topNav-->
  <%@include   file="../header_menu.jsp" %>
<!--end topNav-->
<form>
<input type="hidden" name="orderId" 	id="orderId" 		value="${order.orderId}">
<%-- <input type="hidden" name="orderToken" 	id="orderToken" 	value="${orderToken}">
<input type="hidden" name="orderPrice" 	id="orderPrice" 	value="${order.payPrice}">
<input type="hidden" name="payCorn" 	id="payCorn" 		value="${order.payCorn}" > --%>

<!--购买成功确认信息-->
<div class="shop_bodylist" style="padding-top:20px;min-height:675px;padding-left:60px;" >
	<div class="shop_bodytitle" style="padding-top:70px;padding-bottom:30px;">
		<div class="shop_paytitle">在线支付</div>
	</div>
	<div class="shop_pay">
		<p><span style="font-weight:bold;margin-right:10px;">当前账号：</span>${loginName}</p>
		<p><span style="font-weight:bold;margin-right:10px;">账户余额：</span>0学习币</p>
		<p><span style="font-weight:bold;margin-right:10px;">应付金额：</span><span style="font-size:16px;color:#FF6600">¥${calculate.payAmount}</span></p>
	</div>
	<div class="shop_payacc">
		<div class="shop_payfor">支付方式：</div>
	</div >
	<div class="shop_payacc" style="padding-left:220px;">
		<div style="margin-bottom:10px;position:relative;float:left">
			<input type="radio" checked id="payTp" value="ALIPAY">
		</div>
		<div style="position:relative;float:left">
			<label for="alipay" style="float:left;margin-left:10px;"><img src="${imgpath}/images/shop/alipay.gif"></label>
		</div>
	</div>
	<div class="shop_payacc">
		<div class="shop_paynext"> 
			<a href="javascript:nextPay();">
				<div class="shop_sucbottom01"> 下一步 </div>
			</a>			
			<a href="/shop/cart"> <span> 取消</span> </a> </div>
	</div>
</div>

</form>

<!--end购买成功确认信息-->

<!--footer -->
  <%@include   file="../footer.jsp" %>
<!--footer-->

</body>
</html>
